package com.alan.base.utils;

import android.os.SystemClock;
import android.view.View;

public abstract class SlowClickListener implements View.OnClickListener {

    private long lastTime = 0;


    @Override
    public void onClick(View v) {
        long l = SystemClock.elapsedRealtime();
        if (lastTime > 0 && l - lastTime < 500) {
            Logger.d("SlowClickListener onClick quickly!!!");
            return;
        }
        lastTime = l;
        slowClick(v);
    }

    public abstract void slowClick(View v);
}
